package edu.fdzc.springboot01.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import edu.fdzc.springboot01.entity.User;
import edu.fdzc.springboot01.mapper.UserMapper;
import edu.fdzc.springboot01.service.UserService;
import edu.fdzc.springboot01.vo.UserVo;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Override
    public UserVo getByIdWithDept(Integer id) {
        return baseMapper.selectUserWithDept(id);
    }

    @Override
    public List<UserVo> getUsersByDeptId(Integer deptId) {
        return baseMapper.selectUsersWithDeptByDeptId(deptId);
    }

    @Override
    public List<UserVo> getAllUsersWithDept() {
        return baseMapper.selectAllUsersWithDept();
    }
}